package com.example.demo2.d1;

/**
 * @author renyitong
 * @version 1.0.0
 * @createTime 2025年11月19日
 * @Description
 */
public class MyInterfaceImpl implements MyInterface{

    private BStrategy bStrategy;

    public MyInterfaceImpl(BStrategy bStrategy) {
        this.bStrategy = bStrategy;
    }

    @Override
    public void a() {
        System.out.println("共同的a方法逻辑");
    }

    @Override
    public void b() {
        bStrategy.executeB();
    }

}
